<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
<?php 
 $ses_login = $_SESSION['login'];
	 if(empty($ses_login))
{
echo ('
<form action="index.php?page=enter" method="post">
    
    <p align="center">Логин:
      <input name="login" type="text" id="login" size="20" maxlength="20">
    </p>
    <p align="center">Пароль: 
      <input name="pass" type="password" size="20" maxlength="20">
    </p>
    <p align="center">
	
      <input type="submit" name="Submit" value=" Вход">
    </p>
  </form>
                ');

}

else
{
	include ("setting/bd.php");



$sql = "SELECT *
FROM `user`
JOIN `group` ON (`user`.`group`=`group`.`group_id`)
WHERE `user`.`login`='$ses_login'
ORDER BY `user`.`id_user` DESC";
 $result=mysql_query($sql) or die(mysql_error());
	while($data=mysql_fetch_array($result))

	echo ("
         <h4>Categories</h4>
         <ul class=\"category_list\">
	<li><a href=\"#\">Вы вошли как:</a></li>
        <li><a href=\"#\">$data[login]</a></li>
	<li><a href=\"#\">Личный кабинет</a></li>
	<li><a href=\"#\">Сообщения (0)</a></li>
<li><a href=\"index.php?page=sesstop\" id=\"login_pop\" ><font color=\"red\">Выйти</font></a>
	</li>
	</ul>
	
	");
}

	 //
	 ?>
